from service.DataCenter import cache


def check_cache(md5: str):
    # Check if the md5 is in the cache
    if cache.has(md5):
        return True
    else:
        return False


def save_cache(md5: str, temp_path: str):
    # Save the md5 and temp_path to the cache
    cache.save(md5, temp_path)


def load_cache(md5: str):
    """
    从缓存中加载临时路径

    参数:
    md5 (str): 缓存中存储的md5值

    返回:
    str: 缓存中存储的临时路径
    """
    # Load the temp_path from the cache
    return cache.load(md5)
